package com.gwnet.rider.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gwnet.rider.domain.PlatformWalletLog;
import com.gwnet.rider.domain.bo.PlatformWalletLogPageBO;
import com.gwnet.shop.domain.OrderDelivery;
import com.gwnet.shop.domain.OrderInfo;

import java.util.List;

/**
 * <p>
 * 收支记录表 服务类
 * </p>
 *
 * @author WangLiang
 * @since 2024-08-06
 */
public interface PlatformWalletLogService extends IService<PlatformWalletLog> {

    /**
     * 生成财务信息
     * @param orderInfo 订单信息
     * @param delivery 配送单信息
     * @return
     */
    Boolean genWalletLog(OrderInfo orderInfo, OrderDelivery delivery);

    /**
     * 获取已经结算的数量
     * @param orderId 订单ID
     * @param ownerType 所有者类型 OwnerTypeEnum
     * @return 记录数量
     */
    Long getSettledCount(String orderId,Integer ownerType);

    /**
     * 根据订单ID和所有者类型获取日志信息
     * @param orderId 订单ID
     * @param ownerType 所有者类型 OwnerTypeEnum
     * @return
     */
    List<PlatformWalletLog> getLogByOrderId(String orderId,Integer ownerType);


    /**
     * 根据订单ID解冻金额
     * @param orderId
     * @return
     */
    Boolean unfreezingAmount(String orderId);


    /**
     * 分页查询
     * @param pageBO
     * @return
     */
    IPage<PlatformWalletLog> page(PlatformWalletLogPageBO pageBO);
}
